package com.wen.apiclientsdk;

import com.wen.apiclientsdk.client.ApiClient;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties("api.client")
@Data
@ComponentScan //  组件扫描
public class ApiClientConfig {
    private String accessKey;

    private String secretKey;

    /**
     *   方法注入 @Bean
     *   ak、sk 通过ConfigurationProperties 注解获取
     *   用户添加 SDK 后 在配置文件中写参数，然后我们通过 api.client下 参数的值获取使用 签名信息
     * @return
     */
    @Bean
    public ApiClient apiClient(){
        return new ApiClient(accessKey,secretKey);
   }

}
